package org.lgiavedoni.android.franq.util.booleanU;

public class BooleanUtil {

	public static Boolean decode(String text) throws UndecodedBoolean {
		String tmp = text.trim().toLowerCase();
		if (tmp.equals("yes") || tmp.equals("y")) {
			return Boolean.TRUE;
		}

		if (tmp.equals("no") || tmp.equals("n")) {
			return Boolean.FALSE;
		}
		throw new UndecodedBoolean();
	}

}
